package com.example.batterynotification;

import android.content.Intent;


public class BatteryReceiverForegroundResources {
	  private static boolean ACChargingTimerState=false;
	  private static boolean USBChargingTimerState=false;	  
	  private static boolean dischargingTimerState=false;	  
	  private static Intent mIntent=null;
	public static void SetBatteryLevel(String level)
	  {
	     	Preferences.savePreferences("batteryLevel", level);

	       if (AboutBatteryPreferences.getLevelPreference() != null) 
	    	   AboutBatteryPreferences.getLevelPreference().setSummary(level);     
	  }
	  
	  public static String GetBatteryLevel()
	  {
		 return Preferences.getStringPreferences("batteryLevel"); 	  
	  } 
	  
	  
	  public static void SetBatteryState(String state)
	   {
	       Preferences.savePreferences("batterystate", state);  

	      if (AboutBatteryPreferences.getStatusPreference() != null)
	   	    	AboutBatteryPreferences.getStatusPreference().setSummary(state);      	   
	  }  
	  
	  public static String GetBatteryState()
	  {
		 return Preferences.getStringPreferences("batterystate"); 
	  }  
	
	    
	  public static void SetBatteryChargingSource(String chargingSource)
	  {
	      Preferences.savePreferences("batteryChargingSource", chargingSource);  
	     if (AboutBatteryPreferences.getChargingSourcePreference() != null)   
	    	   	AboutBatteryPreferences.getChargingSourcePreference().setSummary(chargingSource);      	   
	  }
	 
	 public static String GetBatteryChargingSource()
	 {
		 return Preferences.getStringPreferences("batteryChargingSource"); 	  
	 }   
	 
	 
	 public static void SetBatteryTemperature(String temp)
	 {
	     Preferences.savePreferences("batterytemperature", temp);  
	    if (AboutBatteryPreferences.getTemperaturePreference() != null)	   
	 	   	AboutBatteryPreferences.getTemperaturePreference().setSummary(temp);      	   
	}

	public static String GetBatteryTemperature()
	{
		 return Preferences.getStringPreferences("batterytemperature"); 	  
	} 

	
	public static void SetBatteryVoltage(String volt)
	{
	    Preferences.savePreferences("batteryvoltage", volt);  
	   if (AboutBatteryPreferences.getVoltagePreference()!= null)  	   
		   	AboutBatteryPreferences.getVoltagePreference().setSummary(volt);      	   
	}

	public static String GetBatteryVoltage()
	{
		return Preferences.getStringPreferences("batteryvoltage");   
	} 

	
	public static void SetBatteryHealth(String health)
	{
	    Preferences.savePreferences("batteryhealth", health);  
	   if (AboutBatteryPreferences.getHealthPreference()!= null)	   
		   	AboutBatteryPreferences.getHealthPreference().setSummary(health);      	   
	}

	public static String GetBatteryHealth()
	{
		 return Preferences.getStringPreferences("batteryhealth"); 	  
	} 
	  
	public static void setACChargingTimerStarted(boolean bTimer)
	{
		ACChargingTimerState=bTimer;
	}


	public static boolean isACChargingTimerStarted()
	{
		return ACChargingTimerState;
	}
	public static void setDischargingTimerStarted(boolean bTimer)
	{
		dischargingTimerState=bTimer;
	}
	public static boolean isDischargingTimerStarted()
	{
		return dischargingTimerState;
	}	
	public static void setUSBChargingTimerStarted(boolean bTimer)
	{
		USBChargingTimerState=bTimer;
	}
	
	public static boolean isUSBChargingTimerStarted()
	{
		return USBChargingTimerState;
	}	
	public static void setBatteryIntent(Intent intent)
	{
		mIntent = intent ;
	
	}
	public static Intent getBatteryIntent()
	{
		return mIntent ;
	}
}
